package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiElineMapper;
import com.ruoyi.net.domain.ElementBusiEline;
import com.ruoyi.net.service.IElementBusiElineService;

/**
 * 网元-业务-elineService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiElineServiceImpl implements IElementBusiElineService 
{
    @Autowired
    private ElementBusiElineMapper elementBusiElineMapper;

    /**
     * 查询网元-业务-eline
     * 
     * @param id 网元-业务-eline主键
     * @return 网元-业务-eline
     */
    @Override
    public ElementBusiEline selectElementBusiElineById(String id)
    {
        return elementBusiElineMapper.selectElementBusiElineById(id);
    }

    /**
     * 查询网元-业务-eline列表
     * 
     * @param elementBusiEline 网元-业务-eline
     * @return 网元-业务-eline
     */
    @Override
    public List<ElementBusiEline> selectElementBusiElineList(ElementBusiEline elementBusiEline)
    {
        return elementBusiElineMapper.selectElementBusiElineList(elementBusiEline);
    }

    /**
     * 新增网元-业务-eline
     * 
     * @param elementBusiEline 网元-业务-eline
     * @return 结果
     */
    @Override
    public int insertElementBusiEline(ElementBusiEline elementBusiEline)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiEline.getId())) {
            elementBusiEline.setId(uuid);
        }
        elementBusiEline.setCreateBy(SecurityUtils.getUsername());
        elementBusiEline.setCreateTime(DateUtils.getNowDate());
        elementBusiEline.setUpdateBy(SecurityUtils.getUsername());
        elementBusiEline.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineMapper.insertElementBusiEline(elementBusiEline);
    }

    /**
     * 修改网元-业务-eline
     * 
     * @param elementBusiEline 网元-业务-eline
     * @return 结果
     */
    @Override
    public int updateElementBusiEline(ElementBusiEline elementBusiEline)
    {
        elementBusiEline.setUpdateBy(SecurityUtils.getUsername());
        elementBusiEline.setUpdateTime(DateUtils.getNowDate());
        return elementBusiElineMapper.updateElementBusiEline(elementBusiEline);
    }

    /**
     * 批量删除网元-业务-eline
     * 
     * @param ids 需要删除的网元-业务-eline主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineByIds(String[] ids)
    {
        return elementBusiElineMapper.deleteElementBusiElineByIds(ids);
    }

    /**
     * 删除网元-业务-eline信息
     * 
     * @param id 网元-业务-eline主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiElineById(String id)
    {
        return elementBusiElineMapper.deleteElementBusiElineById(id);
    }
}
